﻿SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[FeedFolder](
	[FolderID] [int] IDENTITY(1,1) NOT NULL,
	[FolderName] [varchar](50) NOT NULL,
	[IsActive] [bit] NULL,
	[LastUpdBy] [varchar](25) NULL,
	[LastUpdDt] [smalldatetime] NULL
 CONSTRAINT [PK_FeedFolder] PRIMARY KEY CLUSTERED 
(
	[FolderID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[FeedChannel](
	[ChannelID] [int] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](1000) NOT NULL,
	[Link] [varchar](1000) NOT NULL,
	[Description] [varchar](max) NOT NULL,
	[IsActive] [bit] NULL,
	[LastUpdBy] [varchar](25) NULL,
	[LastUpdDt] [smalldatetime] NULL
 CONSTRAINT [PK_FeedChannel] PRIMARY KEY CLUSTERED 
(
	[ChannelID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[FeedChannelFolder](
	[ChannelID] [int]  NOT NULL FOREIGN KEY REFERENCES [dbo].[FeedChannel]([ChannelID]),
	[FolderID] [int]  NOT NULL FOREIGN KEY REFERENCES [dbo].[FeedFolder]([FolderID]),	
	[IsActive] [bit] NULL,
 CONSTRAINT [PK_FeedChannelFolder] PRIMARY KEY CLUSTERED 
(
	[ChannelID] ASC,
	[FolderID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

Go

CREATE TABLE [dbo].[FeedNewsItem](
	[NewsItemID] [int] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](1000) NOT NULL,
	[Description] [varchar](max) NOT NULL,
	[Link] [varchar](1000) NOT NULL,
	[PubDate] [smalldatetime]  NULL,
	[Author] [varchar](512)  NULL,
 CONSTRAINT [PK_FeedNewsItem] PRIMARY KEY CLUSTERED 
(
	[NewsItemID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

CREATE TABLE [dbo].[FeedNewsItemChannel](
	[ChannelID] [int]  NOT NULL FOREIGN KEY REFERENCES [dbo].[FeedChannel]([ChannelID]),
	[NewsItemID] [int]  NOT NULL FOREIGN KEY REFERENCES [dbo].[FeedNewsItem]([NewsItemID]),	
	[IsActive] [bit] NULL,
 CONSTRAINT [PK_FeedNewsItemChannel] PRIMARY KEY CLUSTERED 
(
	[ChannelID] ASC,
	[NewsItemID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF



